package com.tiantian.homework_3_register.controller;

import com.tiantian.homework_3_register.pojo.Result;
import com.tiantian.homework_3_register.pojo.User;
import com.tiantian.homework_3_register.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/users")
@CrossOrigin
public class RegisterController {

    @Autowired
    private UserService userService;

    @PostMapping("/register")
    public Result register(@RequestBody User user){
        return userService.register(user);
    }
}
